package com.test.study.ToolsUtils.strom.drpc;

import org.apache.storm.Config;
import org.apache.storm.StormSubmitter;
import org.apache.storm.drpc.LinearDRPCTopologyBuilder;
import org.apache.storm.generated.AlreadyAliveException;
import org.apache.storm.generated.AuthorizationException;
import org.apache.storm.generated.InvalidTopologyException;

public class RemoteTopologyDrpc {
	@SuppressWarnings("deprecation")
	public static void main(String[] args) {
		LinearDRPCTopologyBuilder linearDRPCTopologyBuilder = new LinearDRPCTopologyBuilder("fun");
		linearDRPCTopologyBuilder.addBolt(new MyBolt());
		Config stormConf=new Config();
		try {
			StormSubmitter.submitTopology("remoteTopologyDrpc", stormConf, linearDRPCTopologyBuilder.createRemoteTopology());
		} catch (AlreadyAliveException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InvalidTopologyException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (AuthorizationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
